/*
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *如果数据库字段发生变化，请在代码生器重新生成此Model
 */
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SqlSugar;
using VOL.Entity.SystemModels;

namespace VOL.Entity.DomainModels
{
    [SugarTable("stockinordermodel", TableDescription = "入库单主表")]
    [Entity(TableCnName = "入库单主表", TableName = "stockinordermodel")]
    public partial class StockInOrderModel : BaseEntity
    {
        /// <summary>
        /// 主键
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        [Key]
        [Display(Name = "主键")]
        [Column(TypeName = "bigint")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public long Id { get; set; }

        /// <summary>
        /// 入库单号(自动生成系统编号)
        /// </summary>
        [Display(Name = "入库单号")]
        [Column(TypeName = "longtext")]
        [Editable(true)]
        public string stockInCode { get; set; }

        /// <summary>
        /// 仓库 ID
        /// </summary>
        [Display(Name = "仓库ID")]
        [Column(TypeName = "bigint")]
        [Editable(true)]
        public long? warehouseId { get; set; }

        /// <summary>
        /// 入库日期
        /// </summary>
        [Display(Name = "入库日期")]
        [Column(TypeName = "datetime")]
        [Editable(true)]
        public DateTime? stockInDate { get; set; }

        /// <summary>
        /// 关联单号(如进货单号)
        /// </summary>
        [Display(Name = "关联单号")]
        [Column(TypeName = "longtext")]
        [Editable(true)]
        public string relatedOrderCode { get; set; }

        /// <summary>
        /// 供应商Id
        /// </summary>
        [Display(Name = "供应商Id")]
        [Column(TypeName = "bigint")]
        [Editable(true)]
        public long? supplierId { get; set; }

        /// <summary>
        /// 联系人
        /// </summary>
        [Display(Name = "联系人")]
        [Column(TypeName = "longtext")]
        [Editable(true)]
        public string contactPerson { get; set; }

        /// <summary>
        /// 联系方式
        /// </summary>
        [Display(Name = "联系方式")]
        [Column(TypeName = "longtext")]
        [Editable(true)]
        public string contactPhone { get; set; }

        /// <summary>
        /// 经办人ID(关联用户表)
        /// </summary>
        [Display(Name = "经办人ID")]
        [Column(TypeName = "int")]
        [Editable(true)]
        public int? userId { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [Display(Name = "备注")]
        [Column(TypeName = "longtext")]
        [Editable(true)]
        public string remark { get; set; }

        /// <summary>
        /// 单据状态(如"草稿""待审核""已完成""驳回"等)
        /// </summary>
        [Display(Name = "单据状态")]
        [Column(TypeName = "int")]
        [Editable(true)]
        public int? status { get; set; }

        /// <summary>
        /// 审核人(单据审核后赋值)
        /// </summary>
        [Display(Name = "审核人")]
        [Column(TypeName = "longtext")]
        [Editable(true)]
        public string auditUser { get; set; }

        /// <summary>
        /// 审核时间(单据审核后赋值)
        /// </summary>
        [Display(Name = "审核时间")]
        [Column(TypeName = "datetime")]
        [Editable(true)]
        public DateTime? auditTime { get; set; }

        /// <summary>
        /// 删除标识
        /// </summary>
        [Display(Name = "删除标识")]
        [Column(TypeName = "tinyint")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public sbyte IsDel { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        [Display(Name = "创建人")]
        [MaxLength(15)]
        [Column(TypeName = "varchar(15)")]
        [Editable(true)]
        public string Creator { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [Display(Name = "创建时间")]
        [Column(TypeName = "datetime")]
        [Editable(true)]
        public DateTime? CreateDate { get; set; }

        /// <summary>
        /// 修改人
        /// </summary>
        [Display(Name = "修改人")]
        [MaxLength(15)]
        [Column(TypeName = "varchar(15)")]
        [Editable(true)]
        public string Modifier { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        [Display(Name = "修改时间")]
        [Column(TypeName = "datetime")]
        [Editable(true)]
        public DateTime? ModifyDate { get; set; }

        /// <summary>
        /// 创建人id
        /// </summary>
        [Display(Name = "创建人id")]
        [Column(TypeName = "int")]
        [Editable(true)]
        public int? CreateID { get; set; }

        /// <summary>
        /// 修改人id
        /// </summary>
        [Display(Name = "修改人id")]
        [Column(TypeName = "int")]
        [Editable(true)]
        public int? ModifyID { get; set; }

        /// <summary>
        /// 类型（1:进货入库, 2:销售退货）
        /// </summary>
        [SugarColumn(ColumnName = "inOutTypeld", IsNullable = true)]
        [Display(Name = "类型")]
        [Column(TypeName = "bigint")]
        [Editable(true)]
        public long? inOutTypeId { get; set; }

        /// <summary>
        /// 仓库名称（关联查询）
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        [Display(Name = "仓库名称")]
        public string WarehouseName { get; set; }

        /// <summary>
        /// 供应商名称（关联查询）
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        [Display(Name = "供应商名称")]
        public string SupplierName { get; set; }

        /// <summary>
        /// 经办人姓名（关联查询）
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        [Display(Name = "经办人姓名")]
        public string UserName { get; set; }

        /// <summary>
        /// 单据状态名称
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        [Display(Name = "单据状态名称")]
        public string StatusName { get; set; }

        /// <summary>
        /// 入库货品（从明细表汇总）
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        [Display(Name = "入库货品")]
        public string StockInGoods { get; set; }

        /// <summary>
        /// 入库数量（从明细表计算）
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        [Display(Name = "入库数量")]
        public int? TotalQuantity { get; set; }

        /// <summary>
        /// 入库金额（从明细表计算）
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        [Display(Name = "入库金额")]
        public decimal? TotalAmount { get; set; }

        /// <summary>
        /// 所在部门（关联查询）
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        [Display(Name = "所在部门")]
        public string DeptName { get; set; }
    }
}

